From: Jens Axboe Date: Sat, 3 Dec 2016 19:08:03 +0000 (-0700) Subject: nbd: fix 64-bit division X-Git-Tag: archive/raspbian/4.9.13-1+rpi1~11^2~60 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com//%22stanciumarius94%40gmail.com/%22/%22http:/www.example.com/%22stanciumarius94%40gmail.com/%22?a=commitdiff_plain;h=650f550261369bc1677b713427927fa489891ab9;p=linux-4.9.git nbd: fix 64-bit division We have this: ERROR: "__aeabi_ldivmod" [drivers/block/nbd.ko] undefined! ERROR: "__divdi3" [drivers/block/nbd.ko] undefined! nbd.c:(.text+0x247c72): undefined reference to `__divdi3' due to a recent commit, that did 64-bit division. Use the proper divider function so that 32-bit compiles don't break. Fixes: ef77b515243b ("nbd: use loff_t for blocksize and nbd_set_size args") Signed-off-by: Jens Axboe Gbp-Pq: Topic bugfix/all Gbp-Pq: Name nbd-fix-64-bit-division.patch --- diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 095b4589c2d5..c9441f9d4585 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -648,7 +648,7 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd, case NBD_SET_SIZE: return nbd_size_set(nbd, bdev, nbd->blksize, - arg / nbd->blksize); + div_s64(arg, nbd->blksize)); case NBD_SET_SIZE_BLOCKS: return nbd_size_set(nbd, bdev, nbd->blksize, arg);